﻿Imports BLL
Public Class Login
    Inherits System.Web.UI.Page
    Dim objbll As New UsuarioBLL
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Nothing <> Session("usu_nome")) Then
            Response.Redirect("index.aspx", False)
        End If
    End Sub

    Protected Sub blogin_Click(sender As Object, e As EventArgs) Handles blogin.Click
        Dim s As String
        Dim login, senha As String
        login = TLogin.Text.Replace("'", "")
        senha = tSenha.Text.Replace("'", "")
        s = objbll.efetualogin(login, senha)
        If (s = "Senha Inválida" Or s = "Login Inválido" Or s = "Usuário Inativo") Then
            LMSG.Visible = True
            LMSG.Text = s
            LMSG.ForeColor = Drawing.Color.Red
        Else
            Session("usu_nome") = s
            Response.Redirect("index.aspx", False)
        End If
    End Sub
End Class